-1

enter image description here

I am creating CRUD application and don't know how to remove this left and right spaces coming in th and td

thanx in advance :)

Priyanshu
  • 57
  • 9
  • 6
    Provide some code – GucciBananaKing99 Sep 03 '21 at 13:03
  • 2
    Most likely need to remove the [border-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing) – Pete Sep 03 '21 at 13:03
  • 1
    You need to put your code instead of the screenshot for us to understand what is going on under the hood. This way it is impossible to answer. – Harun Yilmaz Sep 03 '21 at 13:03
  • 1
    Does this answer your question? [How to remove unwanted space between rows and columns in table?](https://stackoverflow.com/questions/2279396/how-to-remove-unwanted-space-between-rows-and-columns-in-table) – slow Sep 03 '21 at 13:12
  • `border-spacing: 0;` and `border-collapse: collapse;` maybe help. We need to see how your code is done. – Lucas Marra Sep 03 '21 at 13:18

2 Answers2

0

add this to your table in css:

#yourTable{
  border-collapse: collapse;
}
Pulse
  • 214
  • 2
  • 9
  • Glad I could help. If you accept and like my answer it would be great because someone disliked my answer and I lost 2 reputation – Pulse Sep 05 '21 at 04:48
  • i would definatly do that but i need 15 reputation to like someones answer ......would do it after i get the reputations :) – Priyanshu Sep 05 '21 at 05:01
-1

Looks like it's a border-spacing CSS property set to 1 or so pixels on your table element.

You need to inspect the table and child td and th elements in Chrome or whichever browser's developer tools, and see what CSS styles are attached to those elements.

Specifically, you're checking the table element for border-spacing (as Pete mentions above) with border-collapse set to 'collapse', and then also double-check padding on the td/th elements, because it seems like you've some padding on those cells as well, from the screenshot.

table { 
   border-collapse: separate; /* for border-spacing to work */
   border-spacing: 0px; /* or however much space you want */
}

td, th { 
   /* or however much padding you want */
   padding-left: 0; 
   padding-right: 0;
}

If there's already styles attached to these elements, you'll need to find where they're defined in the CRUD application framework you're developing in to change them...or alternatively, create more specific CSS rules to target this table in your application, so the default values aren't affected for other parts of your application, if that's desired.