How to place an HTML table?

I try to make the table lower and larger on the right if it were originally. How can i do this? What are the attributes? Thanks!

+6
source share
2 answers

Would you like to use CSS for this.

let's say you have a table with id = "my_table" attribute

Would you like to write the following in your css file

#my_table{ margin-top:10px //moves your table 10pixels down margin-left:10px //moves your table 10pixels right } 

if you don’t have a CSS file, you can simply add margin-top:10px, margin-left:10px to the style attribute in your table element, for example:

 <table style="margin-top:10px; margin-left:10px;"> .... </table> 

There are many resources on the web that detail CSS and HTML

+14
source

As mentioned in a BalausC comment, you're probably looking for CSS (cascading style sheets) rather than HTML attributes.

To place an element, a <table> in your case you want to use indents or fields.

the difference between the margins and the gaskets can be considered as a "window model":

box model image

Image from HTML Dog article on fields and additions http://www.htmldog.com/guides/cssbeginner/margins/ .

I highly recommend the article above if you need to learn how to use CSS.

To move the table down and to the right, I would use fields like:

 table{ margin:25px 0 0 25px; } 

This is abbreviated, so the fields are as follows:

 margin: top right bottom left; 
0
source

Source: https://habr.com/ru/post/915863/


All Articles