Markdown & tables

Feature Requests
  • GNU/Linux
    #1

    Since our nodebb supports tables, what about adding some love for them to the CSS ? 🙂


    Markdown:

    First Header | Second Header
    ------------ | -------------
    Content from cell 1 | Content from cell 2
    Content in the first column | Content in the second column
    

    The result isn't that good:

    First Header Second Header
    Content from cell 1 Content from cell 2
    Content in the first column Content in the second column

    I'm using this custom CSS in my NodeBB:

    table
    {
      font-size: 14px;
    	border-collapse:collapse;
    	margin:20px 0 0;
    	padding:0;
    }
    
    table tr
    {
    	border-top:1px solid #ccc;
    	background-color:#fff;
    	margin:0;
    	padding:0;
    }
    
    table tr:nth-child(2n)
    {
    	background-color:#f8f8f8;
    }
    table tr th[align="center"], table tr td[align="center"] {
    	text-align:center;
    }
    table tr th, table tr td
    {
    	border:1px solid #ccc;
    	text-align:left;
    	margin:0;
    	padding:6px 13px;
    }
    

    And the result is quite better:

    marktables.JPG

  • #2

    I very much like this as a optional setting. The reason I say it should be optional is because some people might want to add images in tables and add text in a cell besides that to make it look somewhat blending.

  • Community Rep
    #3

    Adding the classes table table-bordered table-striped to the table tag would work. And would have the advantage of matching whatever theme being used.

  • #4

    This topic totally went under the radar (next time file issues on GH 😄 )

    Updated the markdown plugin as per @yariplus' suggestion and they look good now (see @pier's OP).

    Necroing this because this is the first thread on Google when searching for NodeBB table markdown syntax.


Suggested Topics


  • 1 Votes
    1 Posts
    859 Views

  • 3 Votes
    1 Posts
    1088 Views

  • 0 Votes
    3 Posts
    1714 Views


  • 4 Votes
    2 Posts
    2280 Views

| | | |