Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing table border

I cannot get rid of this table border.

The initial HTML/CSS is from the ASP.NET MVC default.

I removed a lot of code and added a table on top.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>

    <div class="page">

            <table border=0 width=1000 style="border-collapse:collapse;" cellspacing="0" cellpadding="0">
                <tr>
                    <td rowspan=2>
                        <img src="/Content/Images/elk_banner.jpg" />
                    </td>
                    <td>
                        <div id="logindisplay">
                        @Html.Partial("_LogOnPartial")
                        </div>
                    </td>
                </tr>
            </table>

        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
</body>
</html>

I've tried commenting out ALL the CSS, but I can't get rid of it.

My only guess is that one of the cryptic .js files is interferring with it. Or one of these exotic HTML containers is doing it.

Any guesses? I've googled around, but to no avail. I suppose it's something small I'm overlooking.

like image 310
micahhoover Avatar asked Jun 09 '11 08:06

micahhoover


People also ask

Can I remove table border?

Remove all borders to select the table and show the Table Design tab. On the Table Design tab, click the arrow next to Borders and then click No Border .

How do you remove borders from a table cell?

To remove a border, select the cells with the border and click the Borders arrow > No Border.

How do I remove a table cell border in CSS?

This is a Default behavior of the table cells that there is some space between their Borders. To remove this space we can use the CSS border-collapsing Property. This Property is used to set the borders of the cell present inside the table and tells whether these cells will share a common border or not.

How do I remove table borders in Word Online?

To turn them off, select the table and then press [Ctrl]+[Alt]+U. Or right-click the border, choose Borders And Shading from the context menu, and then click None in the Settings section on the Borders tab. Word will dim the borders on screen, but it won't print them.

How to remove border from table in HTML?

Remove Borders From HTML Table Use the border-collapse CSS Property to Remove Border From Cells in Table in HTML Set the CSS border Property to none to Remove Border From a Table in HTML

How to remove border from table in TinyMCE?

1. Using TinyMCE editor, the only way I was able to remove all borders was to use border:hidden in the style like this: <style> table, tr {border:hidden;} td, th {border:hidden;} </style>. And in the HTML like this: <table style="border:hidden;"</table>. Cheers.

How do I add a border to a table element?

To add a border, use the CSS border property on table, th, and td elements: To avoid having double borders like in the example above, set the CSS border-collapse property to collapse. If you set a background color of each cell, and give the border a white color (the same as the document background), you get the impression of an invisible border:

Does the table have borders in any cell?

Only in Firefox 3.5 does the table have no borders in any cell. I'd just like to know how to remove these borders in the other major browsers so that the only thing you see in the table are the alternating row colors.


2 Answers

Try giving your table an ID and then using !important to set border to none in CSS. If JavaScript is tampering with your table then that should get around it.

<table id="mytable"
...

table#mytable,
table#mytable td
{
    border: none !important;
}
like image 65
Marty Avatar answered Oct 07 '22 18:10

Marty


Please try to add this into inside the table tag.

border="0" cellspacing="0" cellpadding="0"

<table  border="0" cellspacing="0" cellpadding="0">
...
</table>
like image 43
Chathuranga Jayanath Avatar answered Oct 07 '22 17:10

Chathuranga Jayanath