Male pin headers can be placed side by side. Females cannot - the ends extend a little too far.
There do exist female headers that are designed to be stacked end-to-end. But they’re hard to find, and unfortunately I don’t know of any parametric search that includes that as a parameter to filter by!
Harwin actually sells a specialized tool for cutting header strips, the Z1022-00. But at almost $350, one would sure have to be cutting a lot of them…
I recently saw a video of how pin headers are made. They don’t snip them to length, they use saws.
Sharing the details of Jane in Shenzhen who is a manufacturer of such male / female pins - can customize to suit. Have met and dealt with her for a number of years. They supply many of the other online vendors who claim to be manufacturers but yet have 2-3 month lead times. Proof is on how quickly they can customize your product. Have seen customized pins in less than 7 business days from this vendor. Perfect results. Highly recommended.
SHENZHEN JINLING ELECTRONICS CO.,LTD.
UL NO.:E362810/E472355/E484895
Address:E Block ,Yusheng Industrial Park,Beside ZhouShiRoad,JiuWei,Xixiang,Bao'an District,Shenzhen,China
Alibaba:https://szjiln.en.alibaba.com/
Http:www.szjiln.com
Email:jane[at]szjiln.com/ janeszjiln[at]gmail.com
If a 20 way header is more easily sourced and requires less mucking about during assembly, maybe its just easier to use 20 pins and have 2x NC pins. At least you can just stuff the board without having to worry about how many pins need to be cut off or combined from multiple off cuts.
I'd go one step farther and make note that 36 and 40 pins are the standard bulk lengths. In many cases, if you order 18 pin headers they will be cut from 36 or 40 pin strips.
I would buy 36 pin lengths and break or cut them in half. No special tools required. Use a pair of pliers to break each strip in half to get two 18 pin strips. Could make a pretty simple jig if you have a lot of them.
But yeah, as has been stated, you can stuff a 10 pin next to an 8 pin, though if they were cut from longer strips then there might be a burr that needs to be removed. There is the additional challenge that the two strips won't line up perfectly without some kind of fixturing. The idea is that any strip is likely to be leaning slightly one way or the other. Snug fitting holes in the PCB will help, but the tips of the two separate strips might be slightly misaligned if they're not held in position while soldering. This could make it difficult to slide on a single 18 pin female connector. Obviously, a single continuous strip will not have that problem.
This could make it difficult to slide on a single 18 pin female connector.
plug a spare female connector in to get things aligned before you start soldering