What is the best method to extend my borders to the very edge?

Struggling with table borders extending to the edge on a website using master pages and CSS stylesheet. This issue requires some troubleshooting, so any help would be appreciated. The problematic website is here. I need the border under the banner menu to reach all the way to the edge without everything getting mashed up when removing the border spacing element from the mainTable style rule. Relevant code below:

<table class="mainTable">
    <tr>
        <td class="masterBannerTop" colspan="6" >
            <a href="Default.aspx"><img style="border: none; display: block; margin: 0 auto;" alt="Travel Joan's Blog Banner" src="Website%20Photos/HeadBanner.jpg" /></a>
        </td>     
    </tr>
    <tr>

    <td class="masterBannerNav"><a href="Default.aspx">HOME</a></td>
    <td class="masterBannerNav"><a href="About.aspx">ABOUT ME</a></td>
    <td>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Font-Size="16pt">
        <LevelMenuItemStyles>
            <asp:MenuItemStyle CssClass="masterBannerMenu" />
        </LevelMenuItemStyles>
        <LevelSubMenuStyles>
            <asp:SubMenuStyle CssClass="subMenuStyle" />
        </LevelSubMenuStyles>
            <Items>
                <asp:MenuItem Text="WHERE I'VE BEEN" NavigateUrl="~/whereivebeen.aspx">
                    <asp:MenuItem Text="UNESCO Sites" NavigateUrl="~/unesco.aspx" />
                    <asp:MenuItem Text="Places" NavigateUrl="~/BlogPosts.aspx" />
                </asp:MenuItem>
            </Items>
        </asp:Menu>
    </td>
    <td class="masterBannerMenu">
        <asp:Menu ID="Menu2" runat="server" Orientation="Horizontal">
        <LevelSubMenuStyles>
            <asp:SubMenuStyle CssClass="masterBannerMenu" />
        </LevelSubMenuStyles>
            <Items>
                <asp:MenuItem Text="PHOTOGRAPHY" NavigateUrl="~/photos.aspx">
                    <asp:MenuItem Text="Street Photos" NavigateUrl="~/StreetPhotos.aspx" />
                    <asp:MenuItem Text="People Photos" NavigateUrl="~/PeoplePhotos.aspx" />
                </asp:MenuItem>
            </Items>
        </asp:Menu>
    </td>
    <td class="masterBannerNav"><a href="Links.aspx">LINKS</a></td>
    <td class="masterBannerNav"><a href="Contact.aspx">CONTACT ME</a></td>

    </tr>
    <tr>
        <td colspan="6">
             </td>
    </tr>
    <tr>
        <td colspan="6" style="border-bottom: 1px solid #DDDDDD;">
             </td>
    </tr>

CSS for referenced elements:

.mainTable
{
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
    border: 1px solid #DDDDDD;
    border-spacing:30px;
}
.masterBannerTop a
{
    background-color: transparent;
    display: block;
    margin: 0 auto;
    border:none;
}
.masterBannerNav a
{
    font-family:"Century Gothic";
    font-size: 16pt;
    width: auto;
    text-align: center;  
    color: Black;
    text-decoration: none;   
    white-space: nowrap;

}
.masterBannerMenu a
{
    font-family:"Century Gothic";
    font-size: 16pt;
    width: auto;
    text-align: left;  
    color: Black;
    text-decoration: none;   

}

Tried ensuring no padding in .mainTable, any other suggestions?

Answer №1

Have you ever considered what the <table> element is typically used for? Tables are best suited for displaying tabular data, not for composing emails as if you were using Excel.

If you're unsure about how to proceed, this article might provide some guidance to help you make the right decision.


By setting the CSS property border-spacing:30px; on the <table>, achieving your desired layout may prove difficult. Consider using a <div> element instead for an easier solution.

You can redesign your layout by utilizing two nested <table> elements, as shown in this example: http://jsfiddle.net/Qtmkw/4/. This approach should work effectively for your needs :)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

CSS styling not rendering consistently across various web browsers

Hey everyone! I've encountered an issue with my webpage. Feel free to check out the code on my CodePen here. When I view this page on Safari, everything looks perfect. However, when I switch over to Chrome or Firefox, the layout is all messed up. Ele ...

Is there anyone who can assist in refining the padding and margin issues within this Galleria.js implementation?

I am struggling to understand why the padding and margins around the images in this slideshow theme on PregoApp are uneven. Despite my attempts to adjust the CSS, the issue persists. You can view the site here. Another website using the same implementati ...

Troubleshooting Date Problems in Angular

When using the HTML5 date picker, I have encountered an issue where after choosing a date, the ng-model displays an older date instead of the current one selected. <input type="date" ng-model="dateModel" /> For example, when selecting the current d ...

jQuery UI Tab displays the initial tab

I have an ASP:Button control in tab-2. When I insert something in the database in the onClick method, it returns to the first tab but I want it to stay on the current tab. Also, the page must reload. How can I achieve this? <asp:Button ID="btnAddCont ...

Changing the screen resolution can cause the LI elements to become disorganized and appear out of

I have a menu that displays multiple links using a styled UL. Everything looks great at 100% resolution, but when I adjust the screen resolution, the links no longer fit within the menu and some end up on another line, causing issues. My concern is this - ...

Display specific data within the <td> tag

I am attempting to display a specific value that is located within a <td> element. The values are retrieved from a webpage and they are structured as follows: <b>General Information</b> <table width="400"> <tr> ...

Conflict between the top menu and body on the HTML page is causing issues

Encountered an issue with my HTML code: CSS: .fixedmenu { overflow: hidden; background-color:rgb(153,0,51); position: fixed; /* Ensures the navbar stays in place */ top: 0; /* Positions it at the top of the page */ width: 100%; /* Occ ...

Error: JSDOM - The document variable has not been declared

After creating a basic webpage that displays a single message, I decided to experiment with JSDOM and encountered an error. Despite researching online examples and Stack Overflow questions, I have struggled to resolve even the most straightforward scenario ...

Is it possible to detect inline elements that have been wrapped?

I am facing a challenge with displaying an indefinite amount of in-line elements. Depending on the width of the browser, some elements may shift to a new line. I am curious to know if it is possible to identify and isolate these rows of elements, or if the ...

Prevent users from selecting an option depending on a specific criteria

I need help with disabling select options based on specific time instances. For example, I want the user to provide specifications by 6:00 am in order to use the system at 10:00 am, ensuring there is a 4-hour gap between the two times. So, after 6:00 am, t ...

How can an external style sheet be inserted into an iframe?

My website features an editor on one side and an iframe on the other. Currently, anytime HTML code is entered into the editor and a keyup event occurs, the iframe updates automatically. I am looking to add default styling to the code entered in the editor ...

Tips for detecting the height of a row with 2 columns in CSS

I am attempting to create two text/image boxes side by side, where one box dictates the height of both on desktop. In this scenario, the leftcol box should expand its background color to match the size of rightcol and center the content. On mobile devices, ...

Combining Two DIVS Side by Side

Hey there, I am working on a timeline using two divs within a table cell. My goal is to have these divs overlap instead of appearing one below the other. The position attribute for all the DIVs inside the cell must remain unchanged due to the drag/drop fu ...

How can I create off-center underlined text?

I am looking to create a unique text effect where the underline is off-centered and overlaps the text. However, I am unsure of how to achieve this. Can someone guide me on the best way to replicate the following effect? https://i.sstatic.net/MEyRk.png Cu ...

Focusing on a text field after reloading a different div with AJAX

I've been spending a lot of time figuring out the following issue and I'm hoping someone can help me find the solution. My web application has an input field (type="text") that is ready to accept user input when the page loads. When the user nav ...

Limiting the character input in ion-textarea within Ionic 2: A step-by-step guide

In my Ionic 2 application, I need to limit user comments to less than 500 characters in a text area. What is the best way to implement this restriction? ...

Is it possible to dynamically load a specific div when the page loads, relying on the

I am using JQuery SlideUp and slideDown methods to toggle the visibility of panels. How can I load or display the first record's contact information as a default? Currently, it loads blank because I set the panel's display property to none: < ...

What is the best way to align flexbox to the left?

I'm having trouble aligning the FileCard component to the start of the container. I attempted using flex-start in my styling, but the FileCards are still centered. This is the current code snippet: <div v-if="posts" ...

Designing a carousel-style menu list with navigation buttons for moving forward and backward

I'm running into some trouble while attempting to create a carousel. Firstly, the issue I am facing is that when you continuously click on the Next button, the function keeps working even after reaching the last item. I'm not sure how to make th ...

unable to access notification popup prior to redirect in ASP.NET

I'm attempting to display an alert box before redirecting, but I'm encountering an issue. The alert box only appears if the redirection is not executed. I have made modifications to the Alert.Show("string") class created by Mads Kristensen as sh ...