Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML table Width = "100%" still didn't fit to window size in ASP.Net

Tags:

html

css

asp.net

I have a html table for displaying data. I have the typical width="100%"; but it did not work. Here is what my page looks like and my CSS/HTML styling. How can I fix it to auto fit the screen?

Code:

<table style="border: medium solid #FFFFFF; background-color: #000000; position: fixed;"
             border="3" width="100%";>
like image 207
Kpt.Khaos Avatar asked Jan 31 '26 08:01

Kpt.Khaos


2 Answers

Make sure your body element has padding and margin set to 0

Without setting this vs when this is set

html, body{
    height:100%;
    width:100%;
    padding:0;
    margin:0;
}
like image 70
SW4 Avatar answered Feb 01 '26 23:02

SW4


Add this CSS:

body {
    margin: 0
}

Because the default margin for body element in not 0

like image 34
frogatto Avatar answered Feb 01 '26 22:02

frogatto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!