Firefox css table generates kill table width

I am working on using only an IE site and making it a cross browser. Everything looks good in IE, Chrome and Safari. However, Firefox is not happy.

I have a table class called "datatable", as this name indicates a data type. I am trying to make it stretch to 100% of the width of the div it contains. Div is above 100%. When I use firebug to test it, the table is stretched to 100%. However, the one that Firefox generates does not stretch to 100%. Therefore, because of this, the rows in the table are smaller than tbody. So I have no idea how to fix this. I tried tbody{width:100%;}and did nothing.

Any ideas that I would really appreciate.

+3
source share
5 answers

Ok, I just answered my question ... inside css there was generic CSS code like this ...

table
{
    border:0px solid #000000;
    padding:0 0 0 0;
    border-collapse:collapse;
    border-spacing:0;
    display:block;
}

I deleted the display: block, and now everything works fine ... I searched for this on the table.datatable definition, but thought about finding a shared file in the file ...

+11
source

This may be silly, but make sure you choose tbody correctly.

#datatable tbody{width:100%} 
+1
source

, width ( , , firefox, ).

table.table_class th {width: 115px; }

, , , CSS.

0

, font-size , 100%.

0

If some browsers need display:blockto <table>, therefore ...

table {
    // Something..
    display: block;
}
body:not(:-moz-handler-blocked) table {
    display: table;
}

Example: HTML in email messages

Just a little hack if you still need to view in Firefox

0
source

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


All Articles