How can I center a table relative to one column in HTML/CSS? -


What I see is something on the lines of this:

  center | + ---- + --------- + | | | | + ---- + --------- + + --------- + ---- + | | | | + --------- + ---- +  

Actually, I am trying to create a table for which some items will prefix (such as currency symbol ) And others have suffixes, however, I want that the cells containing the main cells should be compatible with the center, and the corners come before or after "hang". Am I possibly describing, and perhaps more importantly, is it a good way to cross-browser?

Here's an example I'm referring to:

I'm connected to Bela, if I'm trying to get it, then "X" in the center of the page Will happen.

One way to do this is to use an empty column:

You made as you made, but instead of leaving 2 areas a x empty, and the outer limits of these areas.

  center | + ---- + --------- + ---- + | | | | X | + ---- + --------- + ---- + + ---- + --------- + ---- + | X | | | | + ---- + --------- + ---- +  

You can put the entire table on the page in the center, or it will be appropriate to the left You can. This will not make any difference because the table will be automatically aligned. Make it a super simple table, like

  & lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; 1 & lt; / TD & gt; & Lt; TD & gt; 2 & lt; / TD & gt; & Lt; TD & gt; 3 & lt; / TD & gt; & Lt; Td class = "noborder" & gt; 4 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td class = "noborder" & gt; 1 & lt; / Td> & Lt; TD & gt; 2 & lt; / TD & gt; & Lt; TD & gt; 3 & lt; / TD & gt; & Lt; TD & gt; 4 & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;  

Add CSS accordingly:

  table TD {border: 1px solid black; } .noborder {limit: 0 pixels; }  

Make one for fun


Comments