Jump to content

Table Width Inside Div


satish_j

Recommended Posts

need help relating to width of table inside a left floated div...Setting the width of table does not have any effect..The table is properly displayed in IE( inside its parent div),but for FF,it overflows out of the div..I googled and found that it is default behaviour of FF and IE that leads to this issue..I need any ideas or alternate tricks to display it properly in FF as well..any help???

Link to comment
Share on other sites

Err, link or code?
<div id="sidebar"><table><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td></tr></table></div>

css for div is:

text-align: center;padding: 10px;float: left;border: 1px solid #66ccff;width: 18%;	/*I need to display it on left side of page*/margin-bottom: 5px;

Any inputs now??

Link to comment
Share on other sites

Try this in body tag<div><table id="sidebar"><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td></tr></table></div>Continue with this css codetext-align: center;padding: 10px;float: left;border: 1px solid #66ccff;width: 18%; /*I need to display it on left side of page*/margin-bottom: 5px;

Link to comment
Share on other sites

Try this in body tag<div><table id="sidebar"><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td></tr></table></div>Continue with this css codetext-align: center;padding: 10px;float: left;border: 1px solid #66ccff;width: 18%; /*I need to display it on left side of page*/margin-bottom: 5px;
u mean to say that same css code should be applied for table as well...Only change i can see is the additional id attibute for table???
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...